package com.loctek.importexport.util;

import android.util.Log;

/**
 * Created by slf on 2017/10/12.
 */

public class DebugFlag {

    private static final String LOG_TAG_PREFIX = "FDLog->";

    private static final boolean FLAG_SERVICE = false;
    private static final boolean FLAG_UI = true;//shadow_bg.xml
    private static final boolean FLAG_NET = true;//shadow_bg.xml
    private static final boolean FLAG_DB = true;
    private static final boolean FLAG_INFO = true;//shadow_bg.xml

    private static final boolean FLAG_EXCEPTION = true;

    public static boolean LOG_VISIBLE = true;

    public static void logService(String tag, String msg) {
        if (FLAG_SERVICE && LOG_VISIBLE)
            Log.i(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logNet(String tag, String msg) {
        if (FLAG_NET && LOG_VISIBLE)
            Log.i(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logUI(String tag, String msg) {
        if (FLAG_UI && LOG_VISIBLE)
            Log.i(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logDB(String tag, String msg) {
        if (FLAG_DB && LOG_VISIBLE)
            Log.i(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logInfo(String tag, String msg) {
        if (FLAG_INFO && LOG_VISIBLE)
            Log.i(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logException(String tag, String msg) {
        if (FLAG_EXCEPTION && LOG_VISIBLE)
            Log.e(LOG_TAG_PREFIX + tag, msg);
    }

    public static void logBugTracer(String msg) {
        if (LOG_VISIBLE) {
            Log.i("TLKing_Tracer", msg);
        }
    }

}
